package com.xoa.controller.party;


import com.xoa.model.party.CommunityPatrol;
import com.xoa.service.party.CommunityPatrolService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by 程叶同 on 2018/1/5.
 */
@Controller
@RequestMapping("communitypatrol")
public class CommunityPatrolController {
    @Autowired
    CommunityPatrolService communityPatrolService;

    @RequestMapping("/addPatrol")
    @ResponseBody
    public BaseWrapper addPatrol(HttpServletRequest request, CommunityPatrol communityPatrol){
        return communityPatrolService.addPatrol(request,communityPatrol);
    }

    @RequestMapping("/deletePatrol")
    @ResponseBody
    public BaseWrapper deletePatrol(HttpServletRequest request, Integer id){
        return communityPatrolService.deletePatrol(request,id);
    }
    @RequestMapping("/getPatrolInfo")
    @ResponseBody
    public BaseWrapper getPatrolInfo(HttpServletRequest request, Integer page, Integer pageSize, String subcounty, String processResult){
        return communityPatrolService.getPatrolInfo(request,page,pageSize,subcounty,processResult);
    }
    @RequestMapping("/updatePatrol")
    @ResponseBody
    public BaseWrapper updateData(HttpServletRequest request, CommunityPatrol communityPatrol){
        return communityPatrolService.updateData(request,communityPatrol);
    }
    @RequestMapping("/getdetails")
    @ResponseBody
    public BaseWrapper getDetails(HttpServletRequest request, Integer id){
        return communityPatrolService.getDetails(request,id);
    }

    @RequestMapping("/fileOut")
    @ResponseBody
    public BaseWrapper fileOut(HttpServletRequest request, HttpServletResponse response , String ids){
        return communityPatrolService.fileOut(request,response,ids);
    }

}
